package Collection.work;

import java.util.ArrayList;
import java.util.Collection;

public class Collectionwork {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        System.out.println("c:"+c);
        System.out.println("c的长度为"+c.size());
        System.out.println("是否为空："+c.isEmpty());

        c.clear();
        System.out.println("c:"+c);
        System.out.println("是否为空："+c.isEmpty());
        Collection<Point> c1=new ArrayList<>();
        c1.add(new Point(1,2));
        c1.add(new Point(3,4));
        c1.add(new Point(5,6));
        c1.add(new Point(7,8));

        Point p=new Point(1,2);

        boolean b=c1.contains(p);
        System.out.println("c1是否包含p:"+b);
        c1.remove(p);
        System.out.println("c1:"+c1);

    }
}
